/**
 * @file lib.threadpool.h
 * @author Guannan Ma()
 * @date 2013/02/01 17:30:25
 * @brief  Whatever license applied
 **/
#include "base.h"

#ifndef BASE_LIB_LIB_THREADPOOL_H
#define BASE_LIB_LIB_THREADPOOL_H
#ifdef __cplusplus
extern "C" {
#endif
    typedef (void *) (*thd_func) (void * pvoid);
    struct thd_job {
        thd_func * pfunc;
        uint16 nice; /* By default, nice is 0*/
    };
    BOOL thdpool_init(int n_worker);
    BOOL thdpool_run();
    BOOL thdpool_addjob(struct thd_job * p_job);
    BOOL thdpool_stopjob(struct thd_job * p_job);
    BOOL thdpoll_addworker();
    BOOL thdpoll_delworker();

#ifdef __cplusplus
}
#endif
#endif
/* vim: set tw=0 ts=4 sw=4 et: */
